package com.mobi.cacti.rabbit.connectors;

import com.mobi.cacti.rabbit.response.Cache;

public class TicketDetailServerConnector extends AbstractServerConnector{
	
	private String loadingTicketID;
	
	public void loadTicketDetailForTicket(String ticketId)
	{
		this.loadingTicketID = ticketId;
		
		String url = "https://timonitorappuat.trueinternet.co.th/cactimobileservice/reqtfasticketa.php";
		String xmlData =
				"<?xml version=\"1.0\" encoding=\"utf-8\"?>" +
				"<ReqTFASTicket>" +
				"<ReqSessionID>"+Cache.getRequestSessionID()+"</ReqSessionID>" +
				"<AppUser>COMi</AppUser> " +
				"<AppPass>b5d864cdeb699ebb3d17a6ff70c3aa5e</AppPass>" +
				"<TicketNo>"+ticketId+"</TicketNo> " +
				"</ReqTFASTicket>";

		this.execute(url,xmlData);

	}
	
	@Override
	protected void onPostExecute(String result) {
		
		String[] resultArray = new String[]{loadingTicketID,result};
		delegate.serverConnectorFinishBackgroundTask(this,resultArray);
	};

}
